package day12_coll.demo02_TreeSet;

import java.util.TreeSet;

public class Test {
    public static void main(String[] args) {
        Student zs = new Student("张三", 18);
        Student ls = new Student("李四", 20);
        Student ww = new Student("王五", 19);
        TreeSet<Student> a = new TreeSet<>();
        a.add(zs);
        a.add(ls);
        a.add(ww);
        System.out.println(a);
        for (Student b : a) {
            System.out.println(b.getName());
        }
    }
}
